package com.example.prison.mapper;

import com.example.prison.entity.Refresh;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
* @author jiang
* @description 针对表【refresh】的数据库操作Mapper
* @createDate 2023-06-02 16:15:32
* @Entity com.example.prison.entity.Refresh
*/
@Mapper
public interface RefreshMapper extends BaseMapper<Refresh> {

    @Select("select * from refresh order by id desc")
    List<Refresh> get();

    @Select("select * from refresh where id=#{id}")
    Refresh getById(@Param("id") Integer id);

    @Insert("insert into refresh (rate) values (#{rate})")
    int add(Refresh rate);

    @Update("update refresh set rate=#{rate} where id=#{id}")
    int updateDevice(@Param("id") Integer id, @Param("rate") Integer rate);

}




